import React from 'react'
import style from './periodsList.module.scss'
import { IPeriod } from '../../../starter/model/interfaces'
import dayjs from 'dayjs'
import { DATE_FORMAT } from '../../../starter/constants'


interface IPeriodsList {
  periods: IPeriod[]
}
const PeriodsList = ({periods}: IPeriodsList) => {
  return (
    <ul className={style.wrapper}>
      {periods.map(period => {
        return (
          <li>{dayjs(period.startTime).format(DATE_FORMAT)} - {dayjs(period.endTime).format(DATE_FORMAT)}</li>
        )
      })}
    </ul>
  )
}

export default PeriodsList
